package com.infore.remoteControl.entity.instructionsEntity;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;


/**
 * 指令数据类
 * @author Cold
 *
 */
@Entity
@Table(name="INSTRUCTIONS_DATA")
@NamedQuery(name="InstructionsData.findAll", query="SELECT i FROM InstructionsData i")
public class InstructionsData implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="INSTRUCTIONS_DATA_ID")
	@GeneratedValue(generator = "uuidGenerator")
	@GenericGenerator(name = "uuidGenerator", strategy = "uuid") // UUID生成策略
	private String instructionsDataId;
	
	/** 指令内容 **/
	@Column(name="CONTENT", length = 200)
	private String content;
	
	/** 设备ID(与设备关联) **/
	@Column(name="EQUIPMENT_ID")
	private String equipmentId;
	
	/** 指令ID(与指令关联) **/
	@JsonIgnoreProperties(value = {"instructionsData"})
	@ManyToOne(fetch = FetchType.EAGER) 
	@JoinColumn(name = "INSTRUCTIONS_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	private Instructions instructions;
	
	/** 返回消息 **/
	@Column(name="RETURNINFO", length = 200)
	private String returninfo;
	
	/** 发送策略ID(与发送策略关联) **/
	@Column(name="SENDSTRATEGY_CODE")
	private String sendstrategyCode;
	
	/** 指令状态 **/
	@Column(name="STATE", length = 10)
	private String state;

	public InstructionsData() {
	}

	public String getInstructionsDataId() {
		return instructionsDataId;
	}

	public void setInstructionsDataId(String instructionsDataId) {
		this.instructionsDataId = instructionsDataId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getEquipmentId() {
		return equipmentId;
	}

	public void setEquipmentId(String equipmentId) {
		this.equipmentId = equipmentId;
	}

	public Instructions getInstructions() {
		return instructions;
	}

	public void setInstructions(Instructions instructions) {
		this.instructions = instructions;
	}

	public String getReturninfo() {
		return returninfo;
	}

	public void setReturninfo(String returninfo) {
		this.returninfo = returninfo;
	}

	public String getSendstrategyCode() {
		return sendstrategyCode;
	}

	public void setSendstrategyCode(String sendstrategyCode) {
		this.sendstrategyCode = sendstrategyCode;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	
}